package com.quanxiaoha.weblog.admin.controller;

import com.quanxiaoha.weblog.admin.service.AdminFileService;
import com.quanxiaoha.weblog.common.aspect.ApiOperationLog;
import com.quanxiaoha.weblog.common.utils.R;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/admin")
@AllArgsConstructor
public class AdminFileController {


    private AdminFileService adminFileService;

    @PostMapping("/file/upload")
    @ApiOperationLog(description = "文件上传")
    public R uploadFile(@RequestParam MultipartFile file) {
        return adminFileService.uploadFile(file);
    }

}